package com.SinaMicroblogging;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.widget.TabHost;

public class TabFactory {

	public static void CreateTabSpec(TabHost tabHost, int layOutId, int viewId,
			String tabName, Drawable icon) {

		Context context = tabHost.getContext();
		TabHost.TabSpec tabSpec = tabHost.newTabSpec(tabName);
		LayoutInflater inflatertab = LayoutInflater.from(context);
		inflatertab.inflate(layOutId, tabHost.getTabContentView());
		tabSpec.setIndicator(tabName, icon);
		tabSpec.setContent(viewId);
		tabHost.addTab(tabSpec);

	}
}
